package com.storage.control
{
	import com.firemoss.modelglue.controller.ModelGlueController;
	import com.firemoss.modelglue.event.ModelGlueEvent;
	import com.storage.model.AppModelLocator;
	
	import com.storage.view.sell.SellOrderLayout;
	import com.zzkj.view.widgets.InnerTab;
	
	import mx.collections.ArrayCollection;
	import mx.controls.Alert;

	public class SellOrderController extends ModelGlueController
	{
		public var model:AppModelLocator = AppModelLocator.getInstance();
		
		public function SellOrderController()
		{
			super();
		}
		
		public function changeToSellOrder(e:ModelGlueEvent):void{
			
			var pas:Array = e.getValue("selectItems") as Array;
			var tab:InnerTab = e.getValue("tab") as InnerTab;
			var panel:SellOrderLayout = model.displayPageDic['SellOrderPanels'];
			if(panel==null){
				panel = new SellOrderLayout();
				
				panel.percentHeight = 100;
				panel.percentWidth = 100;
				model.displayPageDic['SellOrderPanels'] = panel;
			}
				
			var ay:ArrayCollection = new ArrayCollection();
			ay.source = pas;
			panel.orderArray = ay ;
			
			tab.next = panel;
			var me:ModelGlueEvent = new ModelGlueEvent('playChangeEffect');
			me.setValue('lab','销售订单');
			me.setValue('begin',tab.current);
			me.setValue('end',tab.next);
			me.setValue('type','CubeRotate');
			me.dispatch(); 
		}
	}
}